phpTopsites Admin - Main

phpTopsites Setup Page
Assumptions and Comments:
While phpTopsites was built to be as easy to use as possible, some requisite knowledge should be possessed before attempted setup and use.  As a minimum:
  • You should have a web server that parses php code.  All versions of phpTopsites after v1.1 will use the .php file extension.  This is in preparation of the coming PHP 4.0 Release which chooses *.php as it's standard file extension.
  • You should have access to a MySQL server that you have permission to use, and you should have full access to at least one "database/hostname/username/password" setup.  If you are confused consult your isp or systems admin.
  • You should know how to use an FTP client or similar file transfer device.
  • Setup would probably be a lot easier if you also know how to login to your web server or web space account with a Telnet client.

phpTopsites has been fully tested on most every environment that the makers of php and mysql claim their own products will run on.  Personally I have set it up on FreeBSD and Linux both using Apache, and I set it up on Windows 98 with the Personal Web Server, and on Windows 2000 w/ IIS 5.0, all successfully.  It'll run most anywhere.

Surprisingly enough, very little knowledge of php and mysql is required for setup.  Explicit instructions are given each step of the setup.  If you experience setup problems, it may be too early in your web career to be using this script.  Don't let that stop you!  Visit the support forum and ask for help.  Explain what you can't get to work in as much detail as possible and someone will respond to help... maybe...

Definition of the word "Upgrade" as quoted from my Mentor, Friend, and Unix God, Mark Finkle:

To Upgrade...is to take out the old bugs...and put in new ones... The point? The point is to remember this is FREE Software.  It comes with absolutely no warranty of any kind.  (
insert favorite disclaimer here) If it appears broken at times, I am sorry.  I'm just a nobody who likes to program.  The best thing to do is to help fix it.  Report the bug, submit the fix, etc...  Everything helps...

May the source be with you...  


Instructions for easy phpTopsites initialization:

1. Read the Security Notes.

2. Chmod your phpTopsites install directory as well as your chosen banner directory so they have write permissions.  This can be accomplished on Unix systems like this:

 chmod 777 /path/to/my/phpTopsites     
 chmod 777 /path/to/my/phpTopsites/banners     

3. Edit config.php with a regular text editor to reflect the proper settings for your particular mysql server setup and several other options that need to be set.  

The basic syntax for connecting to a mysql server from the command line, such as through a telnet client, is like this:

 mysql -uuser -ppassword       (no spaces after -u or -p)

If you cannot establish a connection to your system's mysql server, or if you are unsure, contact your system admin. [MySQL Documentation]

4. Once connected, Create a database called "phpTopsites".  You may call your database anything you want to, but for the purposes of the setup instructions we will assume you named it phpTopsites.

The basic syntax for creating a new mysql database from the command line is like this:

 mysql> create database phpTopsites;          [MySQL Documentation]

Note: If you need to call your database something else besides "phpTopsites", be sure and edit config.php to reflect the change.

After you attempt to create the "phpTopsites" database, you should check yourself by viewing the database.  The basic syntax for viewing databases on a given mysql server is like this:

 mysql> show databases;     

The database you just created should be shown like this:

 +-------------+          
 | Database    |          
 +-------------+          
 | phpTopsites |          
 +-------------+          
 1 rows in set (0.01 sec) 

5. Test the connection to your new "phpTopsites" database by clicking here. If all goes well you'll be back here in a few seconds going to the next step.  If not, then you probably have something wrong with config.php or you have not properly created "phpTopsites".  [MySQL Documentation]

6. Tell the mysql server that "phpTopsites" is the database you would like to use.  Here is the standard syntax:

 mysql> use phpTopsites;     

You should see the following:

 Database changed     

7. Add all the tables, and optionally, the demo data, to the phpTopsites Database that are defined in phpTopsites.sql.txt.  The basic syntax for creating tables in a mysql database is like this:

 mysql> CREATE TABLE accounts ( );     

8. Make sure and create all the tables listed in phpTopsites.sql.txt. You should end up with a total of (4) tables, "
accounts", "admin", "counter", and "categories". Check yourself to ensure this.  The basic syntax for viewing tables within a given database is like this:

 mysql> show tables;     

You should see something like this:

 +-----------------------+     
 | Tables in phpTopsites |     
 +-----------------------+     
 | accounts              |     
 | admin                 |     
 | categories            |     
 | counter               |     
 +-----------------------+     
 4 rows in set (0.01 sec)     
 

Adding the demo data will allow you a generic look and feel to begin with.

9. Tweak your phpTopsites out using the Look and Feel page.  Tweak the Categories here.  If all has gone ok up to this point, you should be safe to run the build.php script.

10. You will need to invoke cron or some other similar utility to run the reset.php script and the build.php script however often you wish to run them.  phpTopsites is designed with the assumption that you will want to reset all the member's hit counts every 24 hours and possibly update (rebuild) phpTopsites every 30 minutes or so.  You will also need access to a precompiled binary of php.  

Here are some example cron entries:

00 01 * * * /usr/local/bin/php ~/admin/reset.php > /dev/null     
0-59/30 * * * * /usr/local/bin/php ~/build.php > /dev/null       

You will probably want to completely delete the master reset script from your website as it is only useful in the development and demo version of phpTopsites.  You run the risk of total site erasure otherwise.

11.  Edit mail.php.  You must uncomment line 20 to send mass mail to members.

12. phpTopsites is distributed under it's own free but restricted software license:

Do's
You may use and alter phpTopsites in any way you wish for your own personal use.
You may attempt to make money using phpTopsites as a web application only.
You may use the phpTopsites code for an infinite time span.

Don'ts
You may not attempt to make money redistributing copies of phpTopsites for profit.
You may never remove the Copyright Text or deface it such that it is not fully readable. 
Please always maintain at least a simple text link to the phpTopsites homepage from your running copy of phpTopsites.
You may not claim you wrote any portion of phpTopsites.
You may not redistribute phpTopsites with any other code or software, FREE or for profit.
You may not commercially redistribute phpTopsites under any conditions.


12. As with any good "Program", never forget the 12th and final step :-)

Send Development Donations to:

Greg Donald
6535 Premier Dr. Apt C-12
Nashville, TN, 37209
Copyright © 1999 phpTopsites All Rights Reserved - code v1.3